import CopyCommand from "../commands/CopyCommand";
import DeleteCommand from "../commands/DeleteCommand";
import CommandRegistry from "../contextmenu/CommandRegistry";
import MenuRegistry from "../contextmenu/MenuRegistry";
import useContextMenu from "../contextmenu/useContextMenu";

MenuRegistry.registry("circle", {
  id: "copy",
  label: "拷贝绿色",
  when: (ctx) => ctx.bgColor === "green",
});

MenuRegistry.registry("circle", {
  id: "delete",
  label: "删除",
});

CommandRegistry.register("copy", CopyCommand);
CommandRegistry.register("delete", DeleteCommand);

const Circle = () => {
  const showMenu = useContextMenu("circle");
  return <div className="circle" onContextMenu={(e) => showMenu(e, {})}></div>;
};

export default Circle;
